import com.Dao.TeacherMapper;
import com.Utils.MybatisUtils;
import com.pojo.Teacher;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

public class Mytest {

   @Test
   public void test1(){
      SqlSession sqlSession = MybatisUtils.getSqlSession();
      TeacherMapper mapper = sqlSession.getMapper(TeacherMapper.class);
      Teacher teacher = mapper.getTeacher(1);
      System.out.println(teacher);
      sqlSession.close();
   }

   @Test
   public void test2(){
      SqlSession sqlSession = MybatisUtils.getSqlSession();
      TeacherMapper mapper = sqlSession.getMapper(TeacherMapper.class);
      Teacher teacher = mapper.getTeacher2(1);
      System.out.println(teacher);
      sqlSession.close();
   }

}
